package com.heu.blood.statistic.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heu.blood.statistic.entity.BloodUsagePurpose;
import com.heu.blood.statistic.entity.BloodUsagePurposeShowVo;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface BloodUsagePurposeDao extends BaseMapper<BloodUsagePurpose> {
//    自定义进行分页
    IPage<BloodUsagePurpose> queryPage(IPage<BloodUsagePurpose> page,Map<String, Object> params);

    // 获取每个用途的总用血量
    List<BloodUsagePurposeShowVo> queryTotalBloodUsageByPurpose();

    // 根据用途查询各血型的用血量
    List<BloodUsagePurposeShowVo> queryBloodUsageByBloodType(String usageCode);

    // 根据用途查询各科室的用血量
    List<BloodUsagePurposeShowVo> queryBloodUsageByDepartment(String usageCode);

    List<String> queryAllDepartments();

    List<String> queryAllBloodTypes();

    List<BloodUsagePurposeShowVo> queryAllPurposes();
}
